<template>
  <tbody>
    <tr>
      <td><input type="checkbox" @click="changge(uindex, uchecked)" /></td>
      <td>{{ uname }}</td>
      <td>{{ uprice }}</td>
      <td>
        <button @click="losenum(uindex)">-</button> {{ unum }}
        <button @click="addnum(uindex)">+</button>
      </td>
      <td>
        {{ unum * uprice }}
      </td>
      <td><button @click="remove(index)">删除</button></td>
    </tr>
  </tbody>
</template>

<script>
export default {
  props: ['uname', 'uprice', 'unum', 'uchecked', 'uindex'],
  data() {
    return {}
  },
  methods: {
    remove(index) {
      this.$emit('del', index)
    },
    changge(index, fla) {
      this.$emit('change', index, fla)
    },
    losenum(index) {
      this.$emit('lose', index)
    },
    addnum(index) {
      this.$emit('add', index)
    },
  },
}
</script>

<style></style>
